3.36 \(\int \frac{\cos (a+\frac{b}{x})}{x} \, dx\)

Optimal. Leaf size=20 \[ \sin (a) \text{Si}\left (\frac{b}{x}\right )-\cos (a) \text{CosIntegral}\left (\frac{b}{x}\right ) \]

[Out]

-(Cos[a]*CosIntegral[b/x]) + Sin[a]*SinIntegral[b/x]

________________________________________________________________________________________

Rubi [A]  time = 0.0273317, antiderivative size = 20, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3378, 3376, 3375} \[ \sin (a) \text{Si}\left (\frac{b}{x}\right )-\cos (a) \text{CosIntegral}\left (\frac{b}{x}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b/x]/x,x]

[Out]

-(Cos[a]*CosIntegral[b/x]) + Sin[a]*SinIntegral[b/x]

Rule 3378

Int[Cos[(c_) + (d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Dist[Cos[c], Int[Cos[d*x^n]/x, x], x] - Dist[Sin[c], Int[Si
n[d*x^n]/x, x], x] /; FreeQ[{c, d, n}, x]

Rule 3376

Int[Cos[(d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Simp[CosIntegral[d*x^n]/n, x] /; FreeQ[{d, n}, x]

Rule 3375

Int[Sin[(d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Simp[SinIntegral[d*x^n]/n, x] /; FreeQ[{d, n}, x]

Rubi steps

\begin{align*} \int \frac{\cos \left (a+\frac{b}{x}\right )}{x} \, dx &=\cos (a) \int \frac{\cos \left (\frac{b}{x}\right )}{x} \, dx-\sin (a) \int \frac{\sin \left (\frac{b}{x}\right )}{x} \, dx\\ &=-\cos (a) \text{Ci}\left (\frac{b}{x}\right )+\sin (a) \text{Si}\left (\frac{b}{x}\right )\\ \end{align*}

Mathematica [A]  time = 0.04694, size = 20, normalized size = 1. \[ \sin (a) \text{Si}\left (\frac{b}{x}\right )-\cos (a) \text{CosIntegral}\left (\frac{b}{x}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b/x]/x,x]

[Out]

-(Cos[a]*CosIntegral[b/x]) + Sin[a]*SinIntegral[b/x]

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 21, normalized size = 1.1 \begin{align*} -{\it Ci} \left ({\frac{b}{x}} \right ) \cos \left ( a \right ) +{\it Si} \left ({\frac{b}{x}} \right ) \sin \left ( a \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a+b/x)/x,x)

[Out]

-Ci(b/x)*cos(a)+Si(b/x)*sin(a)

________________________________________________________________________________________

Maxima [C]  time = 1.4209, size = 58, normalized size = 2.9 \begin{align*} -\frac{1}{2} \,{\left ({\rm Ei}\left (\frac{i \, b}{x}\right ) +{\rm Ei}\left (-\frac{i \, b}{x}\right )\right )} \cos \left (a\right ) - \frac{1}{2} \,{\left (i \,{\rm Ei}\left (\frac{i \, b}{x}\right ) - i \,{\rm Ei}\left (-\frac{i \, b}{x}\right )\right )} \sin \left (a\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x,x, algorithm="maxima")

[Out]

-1/2*(Ei(I*b/x) + Ei(-I*b/x))*cos(a) - 1/2*(I*Ei(I*b/x) - I*Ei(-I*b/x))*sin(a)

________________________________________________________________________________________

Fricas [A]  time = 1.57274, size = 109, normalized size = 5.45 \begin{align*} -\frac{1}{2} \,{\left (\operatorname{Ci}\left (\frac{b}{x}\right ) + \operatorname{Ci}\left (-\frac{b}{x}\right )\right )} \cos \left (a\right ) + \sin \left (a\right ) \operatorname{Si}\left (\frac{b}{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x,x, algorithm="fricas")

[Out]

-1/2*(cos_integral(b/x) + cos_integral(-b/x))*cos(a) + sin(a)*sin_integral(b/x)

________________________________________________________________________________________

Sympy [A]  time = 1.9153, size = 15, normalized size = 0.75 \begin{align*} \sin{\left (a \right )} \operatorname{Si}{\left (\frac{b}{x} \right )} - \cos{\left (a \right )} \operatorname{Ci}{\left (\frac{b}{x} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x,x)

[Out]

sin(a)*Si(b/x) - cos(a)*Ci(b/x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (a + \frac{b}{x}\right )}{x}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x,x, algorithm="giac")

[Out]

integrate(cos(a + b/x)/x, x)